
#include "sentence.h"
#include "assert.h"

sentence::sentence(void)
{
	this->m_ClusterId = 0;
}

sentence::~sentence(void)
{
}

void sentence::init( int nCount)
{
	double value = 0;
	for (int i =0 ; i != nCount; i++)
	{
		this->m_Similaritys.push_back(value);
	}
}

int sentence::setClusterId(int ClusterId )
{
	this->m_ClusterId = ClusterId;
	return 0;
}

int sentence::getClusterId(void)
{
	return this->m_ClusterId;
}

void sentence::setSimilarity(int index, double value)
{
	assert(value > -0.000000001);
	assert(value < 1.000000001);
	this->m_Similaritys[index] = value;
}


double sentence::getSimilarity(int index)
{
	assert(m_Similaritys[index] > -0.000000001);
	assert(m_Similaritys[index] < 1.000000001);
	return this->m_Similaritys[index];
	
}

void sentence::debug_printf()
{
	for (int i = 0; i != this->m_Similaritys.size(); i++)
	{
		printf("%9f", this->m_Similaritys[i]);
	}
	printf(" ID: %9d", this->m_ClusterId);
	printf("\n");
	
}


std::string sentence::getSentence()
	{
		return this->m_sentence;
	}
void sentence::setSentence(std::string sentence)
	{
		this->m_sentence = sentence;
	}
